package cn.cvs.service.impl;

import cn.cvs.dao.SupplierMapper;
import cn.cvs.pojo.Supplier;
import cn.cvs.service.SupplierService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Service("supplierService")
public class SupplierServiceImpl implements SupplierService {
    @Resource
    private SupplierMapper supplierMapper;


    @Override
    public int addSupplier(Supplier supplier) {
        return supplierMapper.addSupplier(supplier);
    }



    @Override
    public int delSupplier(Integer id) {
        return supplierMapper.delSupplier(id);
    }

    @Override
    public int updSupplierById(Supplier supplier) {
        return supplierMapper.updSupplierById(supplier);
    }

    @Override
    public int getSupplierByWhere(String srCode, String name) {
        return supplierMapper.getSupplierByWhere(srCode,name);
    }

    @Override
    public List<Supplier> getSupplierByCodeAndName(String code, String name, Integer pageIndex, Integer pageSize) {
        return supplierMapper.getSupplierByCodeAndName(code, name, (pageIndex-1)*pageSize, pageSize);
    }

    @Override
    public Supplier getSupplierById(Integer id) {
        return supplierMapper.getSupplierById(id);
    }

    @Override
    public List<Supplier> getSupplierList() {
        return supplierMapper.getSupplierList();
    }


}
